package com.jiuwu.bluetoothlegatt;

/**
 * Created by zhangjun on 15/10/25.
 */
public class BpResult {


    public final String[] errorTyeps ={"E-E","E-1","E-2","E-3","E-4","E-C"};

    public int SYS,DIA,PUL;

    public boolean isError;

    public String errorType;

    public BpResult(int sys,int dia,int pul){
        this.isError = false;
        SYS= sys;
        DIA = dia;
        PUL = pul;
    }


    @Override
    public String toString() {
        return "BpResult{" +
                "SYS=" + SYS +
                ", \nDIA=" + DIA +
                ", \nPUL=" + PUL +
                '}';
    }

    public BpResult(byte errorCode){
        isError = true;
        int index = 0;
        switch (errorCode){
            case 0x0E:
                index = 0;
                break;
            case 0x01:
                index = 1;
                break;
            case 0x02:
                index = 2;
                break;
            case 0x03:
                index = 3;
                break;
            case 0x0c:
                index = 4;
                break;
        }
        errorType = errorTyeps[index];

    }


}
